package com.tools.pojo.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;

/**
 * 菜单数据传输对象
 */
@Getter
@Setter
@Schema(description = "菜单数据传输对象")
public class MenuDTO {

    @Schema(description = "菜单ID")
    private Long id;

    @Schema(description = "菜单名称")
    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 50, message = "菜单名称最长50个字符")
    private String name;

    @Schema(description = "菜单类型（DIRECTORY/ MENU/ BUTTON）")
    @NotBlank(message = "菜单类型不能为空")
    @Size(max = 50, message = "菜单类型最长50个字符")
    private String type;

    @Schema(description = "菜单图标")
    private String icon;

    @Schema(description = "路由路径")
    private String path;

    @Schema(description = "组件路径")
    private String component;

    @Schema(description = "权限标识")
    @Pattern(regexp = "^[a-zA-Z0-9:]*$", message = "权限标识只能包含字母、数字和冒号")
    private String permission;

    @Schema(description = "父菜单ID")
    private Long parentId;

    @Schema(description = "显示排序")
    private Integer sort;

    @Schema(description = "重定向路径")
    private String redirect;

    @Schema(description = "菜单状态（ENABLED/ DISABLE）")
    private String status;


    @Schema(description = "当前页")
    private Integer current;

    @Schema(description = "每页数量")
    private Integer size;


    @Schema(description = "是否外链（true/false）")
    private String isExternal;


    @Schema(description = "是否缓存（true/false）")
    private String keepAlive;

}
